#include "robot-config.h"
#include "Chassis.h"

#define LEFT_FRONT_WHEEL_PORT vex::PORT1 

vex::motor Motor = vex::motor(LEFT_FRONT_WHEEL_PORT);

//创建比赛对象
vex::competition    Competition;

//比赛前调用
void pre_auton( void ) {
  // All activities that occur before the competition starts
  // Example: clearing encoders, setting servo positions, ...
  
}

//自动赛程序
void autonomous( void ) {

}

//手动赛程序
void usercontrol( void ) {
  while (1) {
    // 手动赛循环
 Motor.spin(vex::directionType::fwd,50,vex::velocityUnits::rpm);
 
    //延时20ms，防止while循环刷新频率过快
    vex::task::sleep(20); 
  }
}


int main() {
    
    //比赛前调用
    pre_auton();
    
    //比赛对象执行自动赛程序
    Competition.autonomous( autonomous );
    //比赛对象执行手动赛程序
    Competition.drivercontrol( usercontrol );

    //防止main执行完后进入死循环                        
    while(1) {
      //延时100ms，防止资源浪费
      vex::task::sleep(100);
    }    
       
}